package com.yidu.verycd_reception.util;

import lombok.Data;

/**
 * <p>Created with IntelliJ IDEA.</p>
 * <p>User: liandyao</p>
 * <p>Date: 2020-06-29</p>
 * <p>Time: 8:42</p>
 * <p>Description: No Description</p>
 */
@Data
public class BaseMessage {

    public BaseMessage(){
        this.state=SUCCESS;
        this.msg=SUCCESS_MSG;
    }

    public BaseMessage(String msg){
        this.state = ERROR;
        this.msg = msg;
    }


    /**
     * 生成一个成功的返回对象
     * @return
     */
    public static BaseMessage getSuccess(){
        return new BaseMessage();
    }

    /**
     * 成功
     */
    public static final int SUCCESS = 1;

    /**
     * 失败
     */
    public static final int ERROR = 0;


    public static final String SUCCESS_MSG = "操作成功!";


    private int state ;
    private String msg ;
    private Object obj ;

}
